<template>
  <div>
    <mychart :option="option_m" id="Month" width="3.9rem" height="1.75rem"></mychart>
  </div>
</template>

<script>
import * as echarts from "echarts";
import mychart from "../module/mychart.vue";
export default {
  components: { mychart },
  props: ['My'],
  data() {
    return {
      option_m: {}
    }
  },
  created() {
    this.drawbar()
  },
  methods: {
    drawbar() {
      this.option_m = {
        title: {
          text: '每月发现频次',
          top: '-6',
          left: 'center',
          textStyle: {
            color: "#fff",
            fontSize: ".14rem",
            fontWeight: 400,
            fontFamily: "PingFang",
          }
        },
        grid: {
          left: "0",
          top: "20%",
          right: "7%",
          bottom: "0%",
          containLabel: true,
        },
        tooltip: {
          trigger: "axis",
          axisPointer: {
            label: {
              backgroundColor: "#6a7985",
            },
          },
        },
        xAxis: {
          data: [
            "1月",
            "2月",
            "3月",
            "4月",
            "5月",
            "6月",
            "7月",
            "8月",
            "9月",
            "10月",
            "11月",
            "12月",
          ],
          type: "category",
          axisTick: {
            show: false,
            alignWithLabel: false,
          },
          axisLabel: {
            textStyle: {
              show: false,
              fontFamily: "PingFang",
              // color: '#5DCFF6',
              color: "rgba(255, 255, 255, 0.80)",
              fontSize: ".14rem",
            },
              rotate: 45,
              interval: 0,
          },
        },
        yAxis: {
          type: "value",
          splitLine: {
            show: false,
            lineStyle: {
              color: "rgba(255, 255, 255, 0.80)",
            },
          },
          axisLine: {
            show: true, //不显示坐标轴线
          },
          axisLabel: {
            textStyle: {
              fontFamily: "PingFang",
              // color: '#5DCFF6',
              color: "rgba(255, 255, 255, 0.80)",
              fontSize: ".14rem",
            }
          },
        },
        series: [
          {
            data: this.My,
            name: "",
            type: "line",
            symbol: "none",
            symbol: "circle",
            smooth: true,
            symbolSize: 10,
            lineStyle: {
              width: 1,
              type: "solid",
            },
            itemStyle: {
              borderWidth: 2,
              borderColor: "#fff",
              color: "#15F763",
            },
            areaStyle: {
              color: "#fff",
              //线性渐变，前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’，则该四个值是绝对像素位置。
              color: new echarts.graphic.LinearGradient(
                0,
                0,
                0,
                1,
                [
                  {
                    offset: 0,
                    // color: 'RGBA(184, 204, 241, 1)'
                    color: "#15F763",
                  },
                  {
                    offset: 1,
                    color: "#0D152F",
                    // color: '#283D46'
                  },
                ],
                false
              ),
              shadowBlur: 0, //shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。

            },
          },
        ],
      }
    }
  },
}
</script>

<style scoped></style>
